import request from '@/utils/request'

// 卡券分页列表
// /store/coupon/list?pageNum=1&pageSize=10&name=&type=&useType=&status=
export function couponList(query) {
  return request({
    url: '/store/coupon/list',
    method: 'get',
    params: query
  })
}


// 创建优惠券
// /store/coupon/create
export function createCoupon(data) {
  return request({
    url: '/store/coupon/create',
    method: 'post',
    data: data
  })
}

//   修改优惠券状态
// /store/coupon/update/status
export function updateCouponStatus(data) {
  return request({
    url: '/store/coupon/update/status',
    method: 'post',
    data: data
  })
}

//   优惠券详情查询
// /store/coupon/info?id=2
export function couponInfo(query) {
  return request({
    url: '/store/coupon/info',
    method: 'get',
    params: query
  })
}


//   发送优惠券列表
// /store/coupon/send/list?keywords=&type=1
export function couponSendList(query) {
  return request({
    url: '/store/coupon/send/list',
    method: 'get',
    params: query
  })
}

//   优惠券领取记录
// /store/coupon/user/list?pageNum=1&pageSize=10&userId=&couponId=&name=&status=&minPrice=
export function couponUserList(query) {
  return request({
    url: '/store/coupon/user/list',
    method: 'get',
    params: query
  })
}


//   发放优惠券
// /store/coupon/user/receive
export function couponUserReceive(data) {
  return request({
    url: '/store/coupon/user/receive',
    method: 'post',
    data: data
  })
}
